Skip to content

ci: add custom CodeQL workflow for backend/ Go module#17

Merged
revtex merged 1 commit intodevfrom
ci/codeql-custom-workflow
Apr 24, 2026
Merged

ci: add custom CodeQL workflow for backend/ Go module#17
revtex merged 1 commit intodevfrom
ci/codeql-custom-workflow

Conversation

@revtex
Copy link
Copy Markdown
Owner

@revtex revtex commented Apr 24, 2026

Problem

CodeQL default setup was flagging:

Some packages could not be found: 1 package could not be found: github.com/openscanner/openscanner/docs

Root cause: the default setup runs go build / autobuild from the repo root, but OpenScanner's go.mod lives in backend/. The docs package is also generated by swag init and is imported blankly in backend/internal/api/routes.go.

Fix

Adds an advanced CodeQL workflow that mirrors the pattern already used in .github/workflows/ci.yml:

  1. Install swag
  2. Regenerate backend/docs/docs.go from backend/
  3. Run go build ./... from backend/ under CodeQL build-mode: manual
  4. Also analyze JS/TS with build-mode: none

Required manual step after merge

GitHub does not allow default + advanced CodeQL setup simultaneously. Once this is merged to dev (and later main), disable default setup:

Settings → Code security → Code scanning → CodeQL → Switch to advanced setup (or disable default).

Changelog

Pure CI/tooling change — skip-changelog label applied per contributing guide.

Default CodeQL setup runs autobuild from the repo root, which cannot
locate the Go module (go.mod lives in backend/), causing 'package could
not be found: github.com/openscanner/openscanner/docs' warnings.

This workflow mirrors ci.yml: installs swag, regenerates
backend/docs/docs.go, then runs 'go build ./...' from backend/ under
CodeQL's manual build mode. Also analyzes JS/TS with build-mode: none.
@revtex revtex added the skip-changelog PR has no user-visible impact; skip CHANGELOG check label Apr 24, 2026
@revtex revtex merged commit 5cc5d04 into dev Apr 24, 2026
7 checks passed
@revtex revtex deleted the ci/codeql-custom-workflow branch April 24, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog PR has no user-visible impact; skip CHANGELOG check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant